import 'package:card_topia/design_specifications.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';


///自定义底部按钮

class BottomButton extends StatelessWidget {
  const BottomButton({super.key, required this.text, required this.enable, this.onTap, this.isOutline = false, this.width});
  final String text;
  final bool enable;
  final Function? onTap;
  final bool isOutline;
  final double? width;
  @override
  Widget build(BuildContext context) {
    return InkWell(
      onTap: (){
        if(onTap!=null){
          if(enable){
            onTap!();
          }
        }
      },
      child: Container(
        decoration: BoxDecoration(
          color: isOutline?null:(enable?themeColor:disableColor),
          borderRadius: BorderRadius.circular(8),
          border: isOutline?Border.all(color: themeColor):null
        ),
        width: width??MediaQuery.of(context).size.width-32.w,
        height: 48.w,
        alignment: Alignment.center,
        child: Text(text,style: TextStyle(fontFamily: harmony,fontSize: 16.w,color: isOutline?themeColor:Colors.white),),
      ),
    );
  }
}
